module generic_ibufds(
  output reg O,
  input I,
  input IB
);

always @* begin
  if (I & ~IB) O <= 1'b1;
  else if (~I & IB) O <= 1'b0;
  else if ((I === 1'bz | ~I) & (IB === 1'bz | IB)) O <= 1'bx;
  else if (I === 1'bx | IB === 1'bx) O <= 1'bx;
end

endmodule
